#! /bin/bash
function s1_hello(){

   echo "hello, world!"

}
function s2_tell_who_i_am(){

   echo "root"

}

function s3_which_distro_do_i_use(){

   if command -v lsb_release >/dev/null 2>&1; then
      distro=$(lsb_release -i | awk -F:'{print $2}' | tr -d '[:space:]')
   elif [ -f /etc/os-release ]; then
       . /etc/os-release
       distro="$NAME"
   else
      distro=$(cat /etc/*release | grep '^NAME=' | cut -d "=" -f2 | head -n1)
   fi
   echo "NAME=\"$distro\""

}

function s4_view_my_cpu_arch(){

  uname -m

}

function s5_show_first_scsi_disk_size(){

   size_gb=$(lsblk -l | \grep '^sda' | awk '{if ($4!=0) print int($4)}')
   echo "$size_gb"

}

function s6_show_main_memory_size_in_megabytes(){

   mem_total_mb=$(free -m | grep Mem: | awk '{print $2}')
   echo "$mem_total_mb"

}

